<?php include template("header");?>

<div id="bdw" class="bdw">
<div id="bd" class="cf">
	<div id="content" class="clear mainwide">
		<div class="box">
			<div class="box-top"></div>
			<div class="box-content">
				<div class="main-inner clearfix">
					<h2 class="coupon-heading">
						<?php echo $city['name']; ?>
					</h2>
					<!--<p class="coupon-hotcity">
						<span class="title">
							热门城市
						</span>
						<a href="/digu_shop/456">
							深圳
						</a>
						<a href="/digu_shop/455">
							广州
						</a>
						<a href="/digu_shop/1">
							北京
						</a>
						<a href="/digu_shop/3">
							上海
						</a>
					</p>-->
					<!--<div id="JS_Map" class="shop-map">
					</div>			
					<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
					</script>
					<script src="/static/js/dg/shopmap.js">
					</script>
					<script>
						$(document).ready(function() {
							$.ShopMap.initMap('JS_Map');
							//$.ShopMap.load('ajaxData/mapForShop.jsp');
						});
					</script>-->
					<div id="main-inner-guide">
						<div class="link">
							<a href="/help/tour.php">
							</a>
						</div>
					</div>
					<div class="main-content">
						<div class="cpsBG clearfix">
							<div class="pageTop">
								<div class="page">
									<h3>限时优惠</h3>
								</div>
								<div><?php echo $pagestring; ?></div>
							</div>
							<?php if(is_array($teams)){foreach($teams AS $index=>$one) { ?>
							<div class="cp">
								<p class="badge" style="cursor: hand; cursor: pointer;z-index:10;">
									<?php echo $one['discount_rate']; ?><?php echo $currency; ?>
								</p>
								<div class="prodWrap">
									<a href="/team.php?id=<?php echo $one['id']; ?>" title="<?php echo $one['title']; ?>" target="_blank">
										<img class="ci_css_img" src="<?php echo team_image($one['partner']['logo']); ?>" width="250" height="100" alt="<?php echo $one['discount_rate']; ?><?php echo $currency; ?>">
									</a>
								</div> 
								<div class="bar">
									<p class="join_num_and_end_time" style="display:none;">
										<span class="join_number"><?php echo $one['now_number']; ?>人已参加</span>
										<span class="end_time"><?php echo date('Y-m-d',$one['end_time']); ?>截止</span>
									</p>
									<p class="left_time_p" countdown="<?php echo $one['end_time']-time(); ?>">
										<span><?php echo $one['title']; ?></span>
									</p>
									<a href="/team.php?id=<?php echo $one['id']; ?>" target="_blank">
										<p class="clip" style="display:none;"></p>
									</a>
								</div>
							</div>
							<?php }}?>
						</div>
						<script type="text/javascript">
							/*var count_down_str = function(t){
								var m = Math.floor((t / 60) % 60).toString();
								var h = Math.floor((t / 3600) % 24).toString();
								var d = Math.floor((t / 3600) / 24).toString();
								return '还有 <span class="red">' + d + '</span>天<span class="red">' + h + '</span>小时<span class="red">' + m + '</span>分';
							};
							$(".countdowner").each(function(){
								var elem = this;
								var cntdown = function(total, beforetoday){
									if (total > 0){
										var msg = (beforetoday > 0) ? beforetoday + "天前开始，": "今天开始，";
										$(elem).html(msg + count_down_str(total));
										total = total - 60;
										setTimeout(function(){
											cntdown(total, beforetoday);
										},60000);
									} else{
										$(elem).html("活动已结束");
									}
								}
								cntdown($(this).attr("countdown"), $(this).attr("beforetoday"));
							});*/
							$(".cp").mouseover(function() {
								$(this).find(".join_num_and_end_time").show();
								$(this).find(".left_time_p").hide();
								$(this).find(".clip").show();
							}).mouseout(function() {
								$(this).find(".join_num_and_end_time").hide();
								$(this).find(".left_time_p").show();
								$(this).find(".clip").hide();
							});
						</script>
					</div>
					<div class="dg-side">
						<div class="side-my-property">
							<div class="side-my-property-inner">
								<!--<a href="/zombie321">
									<img class="photo" src="file/default/SIGN_39_48x48.jpg" alt="" />
								</a>-->
								<p class="level">
									网络影响力:
									<span class="num">
										<a href="/account/sync.php">
											<?php echo $user_network_weights["total"]; ?>
										</a>
									</span>
								</p>
								<p class="point">
									<?php if(!$login_user){?>
										可以同步到：
										<img src="/static/sync/logo_renren.png" title="人人网" />
										<img src="/static/sync/logo_sina.png" title="新浪微博" />
									<?php } else { ?>
										<?php if(count($user_network_weights) < 3){?>
											还可以同步到：
											<?php if(!array_key_exists('renren', $user_network_weights)){?>
											<a href="/account/ajax/sync_settings.php?web=renren" class="ajaxlink"><img src="/static/sync/logo_renren.png" title="人人网" /></a>
											<?php }?>
											<?php if(!array_key_exists('sina', $user_network_weights)){?>
											<a href="/account/ajax/sync_settings.php?web=sina&action=make_auth_url" class="ajaxlink"><img src="/static/sync/logo_sina.png" title="新浪微博" /></a>
											<?php }?>
										<?php } else { ?>
											更多社区陆续加入！
											<a href="/account/sync.php" style="color:#FFF;">（同步设置）</a>
										<?php }?>
									<?php }?>
								</p>
							</div>
						</div>				
						<?php if($future_teams){?>
						<div class="side-part side-part-first">
							<div class="side-heading">
								<h3>
									活动预告
								</h3>
							</div>
							<div class="content">
								<?php if(is_array($future_teams)){foreach($future_teams AS $index=>$one) { ?>
								<div class="calendar-item">
									<div class="calendar-date">
										<div class="month">
											<?php echo date('n',$one['begin_time']); ?>月
										</div>
										<div class="day">
											<?php echo date('j',$one['begin_time']); ?>
										</div>
									</div>
									<div class="calendar-detail">
										<div class="city">
											<?php echo $one['partner']['title']; ?> | <?php echo $city['name']; ?>
										</div>
										<div class="badge">
											<img src="<?php echo team_image($one['partner']['logo']); ?>" alt="<?php echo $one['title']; ?>" class="partner_logo">
										</div>
										<div class="text">
											<?php echo $one['title']; ?>
											<p class="calendar-go">
												<a href="/team.php?id=<?php echo $one['id']; ?>" class="goto">
													抢先看<img src="/static/css/jp/bluearrow.gif">
												</a>
											</p>
										</div>
									</div>
								</div>						
								<?php }}?>
							</div>
						</div>
						<?php }?>
						<div class="side-part <?php if(!$future_teams){?>side-part-first<?php }?>">
							<div class="side-heading">
								<h3>
									火热活动
								</h3>
								<!--<a href="activities" target="_blank">
									查看全部活动
								</a>-->
							</div>
							<ul class="home-adver-list">
								<li>
									<a href="" target="_blank" title="麦乐团总动员">
										<img src="http://pic.digu.com:80/file/11/31/73/73/default/sysNotice_11317373_1301744169467.jpg" width="255" alt="麦乐团总动员" />
									</a>
								</li>
							</ul>
							<!--<a href="activities" target="_blank">
								查看更多活动
							</a>-->
						</div>
					</div>
				</div>
			</div>
			<div class="box-bottom"></div>
		</div>
	</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<div id="back2top">
</div>
<script type="text/javascript">
	function fixback2top(){
		if ($(window).scrollTop() > 0){
			$("#back2top").show();
		} else{
			$("#back2top").hide();
		}
	};
	function back2topInit(){
		fixback2top();
		$(window).scroll(fixback2top);
		$("#back2top").click(function(){
			$(window).scrollTop(0);
		}).css("left", $(".box").offset().left + $(".box").width() + 5);
	}
	// 加载执行
	try {
		window.attachEvent("onload", back2topInit);
	} catch(e) {
		window.addEventListener("load", back2topInit, false);
	}
</script>

<?php include template("footer");?>